home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / lib / udev / rules.d / 95-kpartx.rules < prev    next >
Text File  |  2009-03-10  |  1KB  |  46 lines

  1. #
  2. # persistent links for device-mapper devices
  3. # only hardware-backed device-mapper devices (ie multipath, dmraid,
  4. # and kpartx) have meaningful persistent device names
  5. #
  6.  
  7. # Always attempt to load dm-multipath. This way we can get rid of the
  8. # init script.
  9. ACTION=="add|change", SUBSYSTEM=="block", \
  10.      RUN+="/sbin/modprobe -Qba dm-multipath"
  11.  
  12. KERNEL!="dm-*", GOTO="kpartx_end"
  13. ACTION=="remove", GOTO="kpartx_end"
  14.  
  15. # This is a temporary hack until Debian's dmsetup properly supports "dmsetup
  16. # export". For more information see: #434241, #487881, #493078
  17. IMPORT{program}="/lib/udev/dmsetup_env %M %m"
  18.  
  19. ENV{DM_TABLE_STATE}!="LIVE", GOTO="kpartx_end"
  20.  
  21. ENV{DM_UUID}=="?*", IMPORT{program}=="kpartx_id %M %m $env{DM_UUID}"
  22.  
  23. OPTIONS="link_priority=50"
  24.  
  25. # Create persistent links for multipath tables
  26. ENV{DM_UUID}=="mpath-*", \
  27.     SYMLINK+="disk/by-id/$env{DM_TYPE}-$env{DM_NAME}"
  28.  
  29. # Create persistent links for dmraid tables
  30. ENV{DM_UUID}=="dmraid-*", \
  31.         SYMLINK+="disk/by-id/$env{DM_TYPE}-$env{DM_NAME}"
  32.  
  33. # Create persistent links for partitions
  34. ENV{DM_PART}=="?*", \
  35.         SYMLINK+="disk/by-id/$env{DM_TYPE}-$env{DM_NAME}-part$env{DM_PART}"
  36.  
  37. # Create dm tables for partitions
  38. ENV{DM_STATE}=="ACTIVE", ENV{DM_UUID}=="mpath-*", \
  39.         RUN+="/sbin/dmsetup ls --target multipath --exec '/sbin/kpartx -a -p -part' -j %M -m %m"
  40. ENV{DM_STATE}=="ACTIVE", ENV{DM_UUID}=="dmraid-*", \
  41.         RUN+="/sbin/kpartx -a -p -part /dev/$kernel"
  42.  
  43. LABEL="kpartx_end"
  44.  
  45.  
  46.